import request from '@/utils/request';

// 获取商品列表
export const getAllGoods = async () => {
  return request('/goods/list', {
    method: 'get',
  });
};

// 添加商品
export const sendAddGoods = async (payload) => {
  return request('/goods/create', {
    method: 'post',
    data: payload,
  });
};

// 删除商品
export const sendDeleteGoods = async (payload) => {
  return request('/goods/delete', {
    method: 'post',
    data: {
      goods_name: payload,
    },
  });
};

// 查询商品
export const sendQueryGoods = async (payload) => {
  return request('/goods/query', {
    method: 'post',
    data: payload,
  });
};

// 更新商品
export const sendUpdateGoods = async (payload) => {
  return request('/goods/update', {
    method: 'post',
    data: payload,
  });
};
